#!/bin/sh
#echo "rawcaudio"
#opt -load ../../../Debug/lib/basicabc.so -basicabc < benchmarks/rawcaudio.bc > temp.bc
#opt -mem2reg < temp.bc > a.bc
#opt -load ../../../Debug/lib/ABCD.so -eSSAPass < a.bc > b.bc
#opt -load ../../../Debug/lib/eSSA.so -eSSAPass2 < temp.bc > c.bc
#opt -load ../../../Debug/lib/demandPass.so -instructionPass < c.bc > d.bc

#echo "rawdaudio"
#opt -load ../../../Debug/lib/basicabc.so -basicabc < benchmarks/rawdaudio.bc > temp.bc
#opt -mem2reg < temp.bc > a.bc
#opt -load ../../../Debug/lib/ABCD.so -eSSAPass < a.bc > b.bc
#opt -load ../../../Debug/lib/eSSA.so -eSSAPass2 < temp.bc > c.bc
#opt -load ../../../Debug/lib/demandPass.so -instructionPass < c.bc > d.bc

#echo "gsm"
#opt -load ../../../Debug/lib/basicabc.so -basicabc < benchmarks/gsm.bc > temp.bc
#opt -mem2reg < temp.bc > a.bc
#opt -load ../../../Debug/lib/ABCD.so -eSSAPass < a.bc > b.bc
#opt -load ../../../Debug/lib/eSSA.so -eSSAPass2 < temp.bc > c.bc
#opt -load ../../../Debug/lib/demandPass.so -instructionPass < c.bc > d.bc

echo "gsm"
opt -load ../../../Debug/lib/basicabc.so -basicabc < benchmarks/gsm.bc > test/gsmInsertChecks.bc
opt -gvn < test/gsmInsertChecks.bc > test/gsmAfterGVN.bc
opt -mem2reg < test/gsmAfterGVN.bc > test/gsmAfterM2r.bc
opt -load ../../../Debug/lib/ABCD.so -eSSAPass < test/gsmAfterM2r.bc > test/gsmAfterInsertPi.bc
opt -load ../../../Debug/lib/eSSA.so -eSSAPass2 < test/gsmInsertPi.bc > test/gsmAfterPropagatePi.bc
opt -load ../../../Debug/lib/demandPass.so -instructionPass <test/gsmAfterPropagatePi.bc > gsmFinal.bc

#echo "g721"
#opt -load ../../../Debug/lib/basicabc.so -basicabc < benchmarks/g721.bc > temp.bc
#opt -mem2reg < temp.bc > a.bc
#opt -load ../../../Debug/lib/ABCD.so -eSSAPass < a.bc > b.bc
#opt -load ../../../Debug/lib/eSSA.so -eSSAPass2 < temp.bc > c.bc
#opt -load ../../../Debug/lib/demandPass.so -instructionPass < c.bc > d.bc

#echo "jpeg"
#opt -load ../../../Debug/lib/basicabc.so -basicabc < benchmarks/jpeg.bc > temp.bc
#opt -mem2reg < temp.bc > a.bc
#opt -load ../../../Debug/lib/ABCD.so -eSSAPass < a.bc > b.bc
#opt -load ../../../Debug/lib/eSSA.so -eSSAPass2 < temp.bc > c.bc
#opt -load ../../../Debug/lib/demandPass.so -instructionPass < c.bc > d.bc

#echo "mpeg2"
#opt -load ../../../Debug/lib/basicabc.so -basicabc < benchmarks/mpeg2.bc > temp.bc
#opt -mem2reg < temp.bc > a.bc
#opt -load ../../../Debug/lib/ABCD.so -eSSAPass < a.bc > b.bc
#opt -load ../../../Debug/lib/eSSA.so -eSSAPass2 < temp.bc > c.bc
#opt -load ../../../Debug/lib/demandPass.so -instructionPass < c.bc > d.bc
